<template>
  <div class="pageTitle">
    <div class="pageIcon">
      <span class="iconfont" :class="icon" v-if="icon"></span>
      <span class="iconfont icon-arrowLeft back" v-else @click="goBack()"></span>
    </div>
    <div class="pageName">{{ title }}</div>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: "页面",
    },
    icon: {
      type: String,
      default: null,
    },
  },
  data() {
    return {};
  },
  created() {},
  methods: {
    goBack() {
      this.$emit("back");
    },
  },
};
</script>

<style lang="less" scoped>
.pageTitle {
  height: 63px;
  border-bottom: 3px solid #f7f8fa;
  display: flex;
  .pageIcon {
    padding: 0 15px 0 23px;
    display: flex;
    justify-content: center;
    align-items: center;
    span {
      width: 29px;
      height: 29px;
      border-radius: 3px;
      background: #206ef7;
      text-align: center;
      line-height: 29px;
      color: #fff;
    }
    .back{
        border-radius: 50%;
        background: #F7F8FA;
        color: #B2BACB;
        font-weight: 600;
    }
  }
  .pageName {
    font-size: 15px;
    font-family: PingFang SC;
    font-weight: bold;
    color: #242c43;
    line-height: 60px;
  }
}
</style>